
public class SearchTreeTest {
	public static void main(String[] args) throws NodeNFException {

		SearchTree<Integer> u = new SearchTree<Integer>();
		u.insert(4);	
		u.insert(2);
		u.insert(6);
		u.insert(8);
		u.insert(9);
		u.insert(7);
		u.insert(5);
		u.insert(3);
		u.insert(1);
		
		System.out.println("In Order :\t"+ u.inOrder());		
		System.out.println("Level Order :\t"+u.levelOrder());
		System.out.println("Post Order :\t" + u.postOrder());
		System.out.println("Pre Order :\t" +u.preOrder());
		System.out.println("Height: "+ u.height()+ "  Size: " + u.size() + "  Leaves: "+ u.leaves()); 
		for (int i = 1; i<10;i++)
			try {
				System.out.println(i + " -> Level: "+ u.level(i) + " Parrent " + u.getParrent(i));
			} catch (NodeNFException e){
				System.out.println(i + " -> "+ e.getMessage());
			}		
		System.out.println("Delete 5 & 6");
		u.delete(5); 
		u.delete(6);
		for (int i = 1; i<10;i++)
			try {
				System.out.println(i + " -> Level: "+ u.level(i) + " Parrent " + u.getParrent(i));
			} catch (NodeNFException e){
				System.out.println(i + " -> "+ e.getMessage());
			}
		System.out.println("Height: "+ u.height()+ "  Size: " + u.size() + "  Leaves: "+ u.leaves()); 
		System.out.println("Delete 4, 7 & 8");
		u.delete(4);
		u.delete(7);
		u.delete(8);
		System.out.println("In Order : " + u.inOrder());
		System.out.println("Height: "+ u.height()+ "  Size: " + u.size() + "  Leaves: "+ u.leaves()); 
		System.out.println("Delete 9, 2, 1 & 3");
		u.delete(9);
		u.delete(2);
		u.delete(1);
		u.delete(3);
		System.out.println("In Order :" + u.inOrder());
		System.out.println("Height: "+ u.height()+ "  Size: " + u.size() + "  Leaves: "+ u.leaves()); 

	}
}
